<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 - ShopEase电商平台</title>
    <!-- Tailwind CSS v3 -->
    <script src="https://cdn.tailwindcss.com"></script>
    <!-- Font Awesome -->
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">

    <!-- Tailwind 配置 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#2563EB',
                        secondary: '#F97316',
                        neutral: {
                            50: '#F8FAFC',
                            100: '#F1F5F9',
                            200: '#E2E8F0',
                            300: '#CBD5E1',
                            400: '#94A3B8',
                            500: '#64748B',
                            600: '#475569',
                            700: '#334155',
                            800: '#1E293B',
                            900: '#0F172A',
                        }
                    },
                    fontFamily: {
                        inter: ['Inter', 'system-ui', 'sans-serif'],
                    },
                    boxShadow: {
                        'card': '0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02)',
                        'card-hover': '0 20px 35px -10px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)',
                    }
                },
            }
        }
    </script>

    <style type="text/tailwindcss">
        @layer utilities {
      .content-auto {
        content-visibility: auto;
      }
      .bg-gradient-soft {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
      }
      .input-focus {
        @apply border-primary ring-2 ring-primary/10;
      }
      .btn-effect {
        @apply transition-all duration-300 hover:shadow-lg hover:-translate-y-0.5 active:translate-y-0;
      }
    }
  </style>
</head>

<body class="font-inter bg-gradient-soft min-h-screen flex flex-col">
    <!-- 顶部通知栏 -->
    <div class="bg-primary text-white text-center py-2 text-sm">
        <p>🎉 新用户登录即送50元优惠券 | 全场满199元免运费</p>
    </div>

    <!-- 导航栏 -->
    <header class="bg-white/80 backdrop-blur-sm shadow-sm">
        <div class="container mx-auto px-4 py-4 flex items-center justify-between">
            <a href="#" class="flex items-center space-x-2">
                <div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center">
                    <i class="fa fa-shopping-bag text-white text-xl"></i>
                </div>
                <span class="text-xl font-bold text-neutral-800">ShopEase</span>
            </a>

            <nav class="hidden md:flex items-center space-x-8">
                <a href="#" class="text-neutral-600 hover:text-primary transition-colors">首页</a>
                <a href="#" class="text-neutral-600 hover:text-primary transition-colors">商品分类</a>
                <a href="#" class="text-neutral-600 hover:text-primary transition-colors">优惠活动</a>
                <a href="#" class="text-neutral-600 hover:text-primary transition-colors">客户服务</a>
            </nav>

            <div class="flex items-center space-x-4">
                <a href="#" class="text-neutral-600 hover:text-primary transition-colors">
                    <i class="fa fa-shopping-cart text-lg"></i>
                </a>
                <button class="md:hidden text-neutral-700">
                    <i class="fa fa-bars text-xl"></i>
                </button>
            </div>
        </div>
    </header>

    <!-- 主要内容 -->
    <main class="flex-grow flex items-center justify-center px-4 py-12 md:py-20">
        <div class="container mx-auto max-w-md w-full">
            <!-- 登录卡片 -->
            <div
                class="bg-white rounded-2xl shadow-card hover:shadow-card-hover transition-all duration-500 overflow-hidden">
                <!-- 卡片头部 -->
                <div class="p-6 md:p-8 border-b border-neutral-100">
                    <div class="text-center mb-1">
                        <h1 class="text-[clamp(1.5rem,3vw,2rem)] font-bold text-neutral-800">欢迎回来</h1>
                        <p class="text-neutral-500 mt-2">请登录您的账户继续购物之旅</p>
                    </div>
                </div>

                <!-- 登录表单 (使用GET方法) -->
                <div class="p-6 md:p-8">
                    <form class="space-y-5" action="\login" method="get">
                        <!-- 用户名输入 -->
                        <div>
                            <label for="username"
                                class="block text-sm font-medium text-neutral-700 mb-1.5">用户名/邮箱</label>
                            <div class="relative">
                                <div class="absolute left-3.5 top-1/2 -translate-y-1/2 text-neutral-400">
                                    <i class="fa fa-user-o"></i>
                                </div>
                                <input type="text" id="username" name="username"
                                    class="w-full pl-10 pr-4 py-3 rounded-lg border border-neutral-200 bg-neutral-50 text-neutral-800 placeholder-neutral-400 transition-all duration-200 focus:outline-none focus:input-focus"
                                    placeholder="请输入用户名或邮箱" required>
                            </div>
                        </div>

                        <!-- 密码输入 -->
                        <div>
                            <div class="flex items-center justify-between mb-1.5">
                                <label for="password" class="block text-sm font-medium text-neutral-700">密码</label>
                                <a href="#"
                                    class="text-sm text-primary hover:text-primary/80 transition-colors">忘记密码？</a>
                            </div>
                            <div class="relative">
                                <div class="absolute left-3.5 top-1/2 -translate-y-1/2 text-neutral-400">
                                    <i class="fa fa-lock"></i>
                                </div>
                                <input type="password" id="password" name="password"
                                    class="w-full pl-10 pr-10 py-3 rounded-lg border border-neutral-200 bg-neutral-50 text-neutral-800 placeholder-neutral-400 transition-all duration-200 focus:outline-none focus:input-focus"
                                    placeholder="请输入密码" required>
                                <button type="button"
                                    class="absolute right-3.5 top-1/2 -translate-y-1/2 text-neutral-400 hover:text-neutral-700 transition-colors toggle-password">
                                    <i class="fa fa-eye"></i>
                                </button>
                            </div>
                        </div>

                        <!-- 记住登录 -->
                        <div class="flex items-center justify-between">
                            <div class="flex items-center">
                                <input id="remember" type="checkbox" name="remember" value="1"
                                    class="w-4 h-4 rounded border-neutral-300 bg-neutral-50 text-primary focus:ring-primary/30">
                                <label for="remember" class="ml-2 text-sm text-neutral-600">记住我 30 天</label>
                            </div>
                        </div>

                        <!-- 登录按钮 -->
                        <button type="submit"
                            class="w-full py-3.5 bg-primary text-white font-medium rounded-lg btn-effect flex items-center justify-center">
                            <i class="fa fa-sign-in mr-2"></i> 登录账户
                        </button>

                        <!-- 注册入口 -->
                        <div class="text-center text-neutral-600 text-sm mt-6">
                            还没有账户？ <a href="register.html" class="text-primary font-medium hover:underline">立即注册</a>
                        </div>
                    </form>

                    <!-- 分隔线 -->
                    <div class="relative my-8">
                        <div class="absolute inset-0 flex items-center">
                            <div class="w-full border-t border-neutral-200"></div>
                        </div>
                        <div class="relative flex justify-center text-sm">
                            <span class="px-3 bg-white text-neutral-500">其他登录方式</span>
                        </div>
                    </div>

                    <!-- 社交登录 -->
                    <div class="grid grid-cols-3 gap-4">
                        <button
                            class="flex items-center justify-center h-12 rounded-lg border border-neutral-200 text-neutral-700 hover:bg-neutral-50 transition-all duration-300">
                            <i class="fa fa-weixin text-xl text-[#07C160]"></i>
                        </button>
                        <button
                            class="flex items-center justify-center h-12 rounded-lg border border-neutral-200 text-neutral-700 hover:bg-neutral-50 transition-all duration-300">
                            <i class="fa fa-qq text-xl text-[#1DA1F2]"></i>
                        </button>
                        <button
                            class="flex items-center justify-center h-12 rounded-lg border border-neutral-200 text-neutral-700 hover:bg-neutral-50 transition-all duration-300">
                            <i class="fa fa-apple text-xl text-neutral-800"></i>
                        </button>
                    </div>
                </div>
            </div>

            <!-- 安全提示 -->
            <div class="mt-6 text-center">
                <div
                    class="inline-flex items-center text-xs text-neutral-500 bg-white px-4 py-2 rounded-full shadow-sm">
                    <i class="fa fa-shield text-primary mr-2"></i>
                    <span>我们采用银行级加密技术保护您的账户安全</span>
                </div>
            </div>
        </div>
    </main>

    <!-- 页脚 -->
    <footer class="bg-white border-t border-neutral-100 py-6">
        <div class="container mx-auto px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <p class="text-neutral-500 text-sm mb-4 md:mb-0">© 2023 ShopEase 电商平台 版权所有</p>
                <div class="flex space-x-6">
                    <a href="#" class="text-neutral-500 hover:text-primary transition-colors text-sm">隐私政策</a>
                    <a href="#" class="text-neutral-500 hover:text-primary transition-colors text-sm">用户协议</a>
                    <a href="#" class="text-neutral-500 hover:text-primary transition-colors text-sm">帮助中心</a>
                </div>
            </div>
        </div>
    </footer>

    <!-- JavaScript -->
    <script>
        // 密码显示/隐藏切换
        document.querySelector('.toggle-password').addEventListener('click', function () {
            const passwordInput = document.getElementById('password');
            const icon = this.querySelector('i');

            if (passwordInput.type === 'password') {
                passwordInput.type = 'text';
                icon.classList.remove('fa-eye');
                icon.classList.add('fa-eye-slash');
            } else {
                passwordInput.type = 'password';
                icon.classList.remove('fa-eye-slash');
                icon.classList.add('fa-eye');
            }
        });

        // 输入框交互效果
        const inputs = document.querySelectorAll('input');
        inputs.forEach(input => {
            input.addEventListener('focus', function () {
                this.parentElement.classList.add('scale-[1.01]');
            });
            input.addEventListener('blur', function () {
                this.parentElement.classList.remove('scale-[1.01]');
            });
        });

        // 从URL查询参数中填充表单（如果有）
        window.addEventListener('DOMContentLoaded', function () {
            const params = new URLSearchParams(window.location.search);

            if (params.has('username')) {
                document.getElementById('username').value = params.get('username');
            }

            if (params.has('remember') && params.get('remember') === '1') {
                document.getElementById('remember').checked = true;
            }
        });
    </script>
</body>

</html>